package com.share.shareplatform.shareorder.dao;


import com.share.shareplatform.pojo.Goods;
import com.share.shareplatform.pojo.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderDao {
    Long addOne(Order order);
    Integer updateOne(Order order);
    Integer deleteOneById(Long id);
    Integer deleteAllByIds(Long[] ids);
    Order findOneById(Long id);
    List<Order> findAllByUserId(Long id);
    List<Order> findAllByUserIdAndState(@Param("id") Long id, @Param("state")String state);
    List<Order> findAllByUserIdAndType(@Param("id") Long id, @Param("type")String type);
    Integer updateAllPaymentStateByIds(@Param("oldState") String oldState,@Param("newState") String newState,@Param("list") List<Long> list);
    Order findOneSafeById(Long id);
    List<Order> findAllByGoodsList(@Param("id") Long id, @Param("goodsList") List<Goods>goodsList);
    List<Order> findAllById(List<Long> list);

}
